package cz.muni.fi.pa165.languageschool.rest;

import cz.muni.fi.pa165.languageschool.dto.StudentTO;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * REST Student resource
 *
 * @author Michal Fucik (3956224) michal.fuca.fucik(at)gmail.com
 */
@XmlRootElement
public class StudentResource extends StudentTO {

    public StudentResource(StudentTO sto) {
        setId(sto.getId());
        setFirstName(sto.getFirstName());
        setLastName(sto.getLastName());
        setEnrolledLectures(sto.getEnrolledLectures());
    }

    public StudentResource() {
    }

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getPlain() {
        return this.toString();
    }
}
